home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 3.8 KB | 134 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FloatFrm.cpp
- // Release Version: $ ODF 1 $
- //
- // Author: Henri Lamiraux
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "ODFDraw.hpp"
-
- #ifndef FLOATFRM_H
- #include "FloatFrm.h"
- #endif
-
- #ifndef DRAWPART_H
- #include "DrawPart.h"
- #endif
-
- // ----- Part Layer -----
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- #ifndef FWCONTXT_H
- #include "FWContxt.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWRECSHP_H
- #include "FWRecShp.h"
- #endif
-
- #ifndef FWWINDOW_H
- #include "FWWindow.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWDEBUG_H
- #include "FWDebug.h"
- #endif
-
- //========================================================================================
- // Runtime Information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfdrawframes
- #endif
-
- //========================================================================================
- // CLASS CFloatingWindowFrame
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::CFloatingWindowFrame
- //----------------------------------------------------------------------------------------
-
- CFloatingWindowFrame::CFloatingWindowFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CDrawPart *drawPart) :
- FW_CFrame(ev, odFrame, presentation, drawPart),
- fDrawPart(drawPart),
- fFacet(NULL),
- fMapping(FW_kDevice)
- {
- SetCanBeActiveFrame(ev, FALSE);
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::~CFloatingWindowFrame
- //----------------------------------------------------------------------------------------
-
- CFloatingWindowFrame::~CFloatingWindowFrame()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::EraseBackground
- //----------------------------------------------------------------------------------------
-
- void CFloatingWindowFrame::EraseBackground(Environment* ev, FW_CGraphicContext& gc)
- {
- FW_CRect rect;
- gc.GetClipRect(rect);
- FW_CInk ink(FW_kRGBLightGray);
- FW_CRectShape::RenderRect(gc, rect, FW_kFill, ink);
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::FacetAdded
- //----------------------------------------------------------------------------------------
-
- void CFloatingWindowFrame::FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount)
- {
- FW_CFrame::FacetAdded(ev, facet, facetCount);
-
- FW_ASSERT(fFacet == NULL); // we know we can't have more than one facet
- fFacet = facet;
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::FacetRemoved
- //----------------------------------------------------------------------------------------
-
- void CFloatingWindowFrame::FacetRemoved(Environment* ev, ODFacet* facet, unsigned short facetCount)
- {
- FW_ASSERT(facet == fFacet); // we know we can't have more than one facet
- fFacet = NULL;
-
- // ----- Call inherited -----
- FW_CFrame::FacetRemoved(ev, facet, facetCount);
- }
-
- //----------------------------------------------------------------------------------------
- // CFloatingWindowFrame::HideShowFloating
- //----------------------------------------------------------------------------------------
-
- void CFloatingWindowFrame::HideShowFloating(Environment* ev)
- {
- FW_CWindow *window = GetWindow(ev);
-
- if (window->IsShown(ev))
- window->Hide(ev);
- else
- window->Show(ev);
- }
-
-
-
-